package com.example.controller;

import com.example.pojo.User;
import com.example.service.UserService;
import io.swagger.annotations.ApiModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/user")
@ApiModel(value="导出", description="")
public class UserExport {
    @Autowired
    private UserService userService;

    @RequestMapping("/export")
    private void exportUser(final HttpServletResponse response){
        try {
            userService.exportUserAll(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @RequestMapping("/exportSome")
    private void exportUserSome(final HttpServletResponse response){
        try {
            userService.exportUserSome(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
